import request from '@/utils/request'

// 查询老人信息列表
export function listElderInfo(query) {
  return request({
    url: '/business/elderInfo/list',
    method: 'get',
    params: query
  })
}

// 查询老人信息详细
export function getElderInfo(id) {
  return request({
    url: '/business/elderInfo/' + id,
    method: 'get'
  })
}

// 新增老人信息
export function addElderInfo(data) {
  return request({
    url: '/business/elderInfo',
    method: 'post',
    data: data
  })
}

// 修改老人信息
export function updateElderInfo(data) {
  return request({
    url: '/business/elderInfo',
    method: 'put',
    data: data
  })
}

// 删除老人信息
export function delElderInfo(id) {
  return request({
    url: '/business/elderInfo/' + id,
    method: 'delete'
  })
}

// 文件上传
export function fileUpload(file) {
  return request({
    url: '/business/elderInfo/upload',
    method: 'post',
    data:file
  })
}
// 文件从minio删除
export function delMinioFile(fileName) {
  return request({
    url: '/business/elderInfo/upload',
    method: 'post',
    params: fileName
  })
}

export function getElderApartment() {
  return request({
    url: '/business/elderlyapartment/allList',
    method: 'post',
  })
}

// 查询所有老人信息
export function listAllElderInfo() {
  return request({
    url: '/business/elderInfo/allElderList',
    method: 'post',
  })
}
// 查询所有老人信息
export function getNewElderInfo() {
  return request({
    url: '/business/elderInfo/newElderInfo',
    method: 'post',
  })
}

export function getElderInfoByName(query) {
  return request({
    url: '/business/elderInfo/getElderbyName',
    method: 'post',
    params: query
  })
}

//突发记录相关接口

// 查询【请填写功能名称】列表
export function listRecord(query) {
  return request({
    url: '/system/record/list',
    method: 'get',
    params: query
  })
}
// 查询详细
export function getRecord(suddenId) {
  return request({
    url: '/system/record/' + suddenId,
    method: 'get'
  })
}

// 新增【请填写功能名称】
export function addRecord(data) {
  return request({
    url: '/system/record',
    method: 'post',
    data: data
  })
}

// 修改【请填写功能名称】
export function updateRecord(data) {
  return request({
    url: '/system/record',
    method: 'put',
    data: data
  })
}

// 删除【请填写功能名称】
export function delRecord(suddenId) {
  return request({
    url: '/system/record/' + suddenId,
    method: 'delete'
  })
}

